home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume14 / lc / part02 < prev    next >
Encoding:
Text File  |  1990-09-15  |  6.6 KB  |  198 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: ssbell!sparky!kent
  3. subject: v14i083: lc - Categorize and List Files In Columns, Part 2 of 2
  4. from: kent@sparky.IMD.Sterling.COM (Kent Landfield)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 14, Issue 83
  8. Submitted-by: kent@sparky.IMD.Sterling.COM (Kent Landfield)
  9. Archive-name: lc/part02
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then feed it
  13. # into a shell via "sh file" or similar.  To overwrite existing files,
  14. # type "sh file -c".
  15. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  16. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  17. # If this archive is complete, you will see the following message at the end:
  18. #        "End of archive 2 (of 2)."
  19. # Contents:  lc.1
  20. # Wrapped by kent@sparky on Fri Sep  7 16:10:04 1990
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'lc.1' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'lc.1'\"
  24. else
  25. echo shar: Extracting \"'lc.1'\" \(4966 characters\)
  26. sed "s/^X//" >'lc.1' <<'END_OF_FILE'
  27. X.\" @(#)lc.1    1.1 9/7/90 Kent Landfield;
  28. X.TH LC 1 "Usenet Source"
  29. X.SH NAME
  30. X.B lc 
  31. X\- categorize and list directory and file names in columns
  32. X.SH SYNOPSIS
  33. X.B lc
  34. X[
  35. X.B \-abcdDefFIlLmMrsS1
  36. X]
  37. X[ directory ... ]
  38. X.SH DESCRIPTION
  39. X.B lc
  40. Xlists the elements of the given directories.  The elements are
  41. Xdivided into minimally five basic types (files, directories, 
  42. Xcharacter special files, block special files, and fifos) and 
  43. Xare printed in alphabetical order.  They are normally printed 
  44. Xcolumn-wise across the screen, preceded by a title indicating
  45. Xthe type. The
  46. X.B \-1
  47. Xoption can be used to force single-column untitled output.
  48. X.PP
  49. X.B lc
  50. Xuses the environment variables
  51. X.B LC
  52. X,
  53. X.B CDPATH 
  54. Xand
  55. X.B COLS 
  56. Xto allow you to set up a default set of display options that
  57. X.B lc
  58. Xshould use each time is it run. Options on the command line override
  59. Xoptions specified in the environment if there is a conflict.
  60. X.B LC
  61. Xis used to set 
  62. X.B lc
  63. Xspecific options. All command line options shown in the option list 
  64. Xbelow can be used in setting default options within the environment 
  65. Xvariable 
  66. X.B LC.
  67. X.B CDPATH 
  68. Xis searched for a file not found at the requested location or
  69. Xin the current directory. This is an extremely handy feature of 
  70. X.B lc.
  71. X.B COLS 
  72. Xis used to switch the column width between 80 and 132 column display.
  73. X.PP
  74. X.B lc 
  75. Xhas incorporated the minimal the spell checking routines found in the book,
  76. XThe UNIX Programming Environment, by Brian Kernighan and Rob Pike.  
  77. X.PP
  78. XIf the command line argument list contains more than one name, the 
  79. Xcontents of the directories named in the list are displayed and all 
  80. Xother names are displayed one per line with the type of the file 
  81. Xdisplayed on the same line. If the 
  82. X.B -D 
  83. Xoption is supplied in the environment or on the command line all 
  84. Xnon-directory files are ignored.  If no file or directory is specified the 
  85. Xcurrent working directory is listed by default.  The special entries
  86. X``.'' and ``..'' are not listed.
  87. X.PP
  88. XNot all options are supported on every system. (e.g. no symbolic links
  89. Xon your system ? Options 
  90. X.B -s, -I -L
  91. Xor 
  92. X.B -l
  93. Xwon't be available...) On systems which support symbolic links, 
  94. Xthe symbolic links are normally followed, and each prints under 
  95. Xthe category of the type of file to which it is linked.  If the 
  96. Xsymbolic link points to a nonexistent path name, or if you do not 
  97. Xhave permission to resolve the path name,
  98. X.B lc
  99. Xprints out an error message indicating it cannot resolve the link.
  100. XThis type of message can be suppressed through the use of the 
  101. X.B 'I'
  102. Xoption described below.
  103. X.SH OPTIONS
  104. X.IP "-a" 6
  105. XList dot files as well. Normally 
  106. X.B lc 
  107. Xdoes not display files beginning with a '.' unless this option is 
  108. Xspecified. The system '.' and '.. files are never displayed since
  109. Xthey give you no real additional information and would just clutter
  110. Xup the display.
  111. X.IP "-b"
  112. XList block special files only.
  113. X.IP "-c"
  114. XList character special files only.
  115. X.IP "-d"
  116. XList directories only.
  117. X.IP "-D"
  118. XDo not display singular files. If you do not use this option and
  119. Xexecute "lc /unix", your output will be "/unix: file". This is 
  120. Xuseful in shell scripts but is sometimes annoying if you execute
  121. Xa command such as "lc /usr/lib/*" and all you wish to see is the
  122. Xfirst level of directories and not a lot of "filename: file" messages.
  123. X.IP "-e"
  124. XMark executable files with '*'. This options allows you to have executables
  125. Xdisplayed with a '*' appended to the end of the file name.
  126. X.IP "-f"
  127. XList regular files only.
  128. X.IP "-F"
  129. XList fifo files only.
  130. X.IP "-I"
  131. XDo not report unresolved symbolic link messages. Normally
  132. X.B lc
  133. Xprints out a message stating that it cannot resolve the symbolic link.
  134. XUse of this option suppresses the display of those messages.
  135. X.IP "-l"
  136. XMark symbolic links with '@'. This options allows you to have symbolic
  137. Xlinks displayed with a '@' appended to the end of the file name.
  138. X.IP "-L"
  139. XDisplay symbolic links. This options allows you to have 
  140. X.B lc
  141. Xoutput a display showing what files the symbolic links refer to.
  142. X.IP "-m"
  143. XList shared memory name space entry files only.
  144. X.IP "-M"
  145. XList semaphore name space entry files only.
  146. X.IP "-r"
  147. XList the directory entries as they appear in the directory file. No 
  148. Xsorting of output prior to displaying.
  149. X.IP "-s"
  150. XList symbolic links only.
  151. X.IP "-S"
  152. XList AF_UNIX socket files only.
  153. X.IP "-1"
  154. XList files one per line instead of in columns.
  155. X.SH DIAGNOSTICS
  156. XThe "only" options can not be combined at this time.
  157. X.PP
  158. XThe spell checking does not work when the CDPATH is searched for a
  159. Xfile or directory not found in the current directory.
  160. X.PP
  161. X.B lc
  162. Xdoes not support recursion but I have never found this to
  163. Xbe that necessary to put in. 
  164. X.nr
  165. X      $ find directory-to-descend -type d -print | xargs lc
  166. X.nf
  167. Xworks just fine when recursion is needed.
  168. X.SH AUTHOR
  169. XKent Landfield <kent@sparky.IMD.Sterling.COM>
  170. X.SH CREDITS
  171. XJeff Minnig <jeff@dsndata> and Rick Ohnemus <rick@sparky.IMD.Sterling.COM> 
  172. Xwere a *great* help with this program at different stages of its development...
  173. XThanks!
  174. END_OF_FILE
  175. if test 4966 -ne `wc -c <'lc.1'`; then
  176.     echo shar: \"'lc.1'\" unpacked with wrong size!
  177. fi
  178. # end of 'lc.1'
  179. fi
  180. echo shar: End of archive 2 \(of 2\).
  181. cp /dev/null ark2isdone
  182. MISSING=""
  183. for I in 1 2 ; do
  184.     if test ! -f ark${I}isdone ; then
  185.     MISSING="${MISSING} ${I}"
  186.     fi
  187. done
  188. if test "${MISSING}" = "" ; then
  189.     echo You have unpacked both archives.
  190.     rm -f ark[1-9]isdone
  191. else
  192.     echo You still need to unpack the following archives:
  193.     echo "        " ${MISSING}
  194. fi
  195. ##  End of shell archive.
  196. exit 0
  197.  
  198.